<?php
abstract class UHU_CallbackProcess
{
	protected $success_callbacks;
	protected $failure_callbacks;
	public function __construct()
	{
		$this->success_callbacks = new UHU_Collection_Callbacks($this);
		$this->failure_callbacks = new UHU_Collection_Callbacks($this);
	}
	public function add_success($callback)
	{
		$this->success_callbacks[] = $callback;
	}
	public function add_failure($callback)
	{
		$this->failure_callbacks[] = $callback;
	}
	public function succeeded()
	{
		$this->success_callbacks->doCallbacks();
	}
	public function failed()
	{
		$this->failure_callbacks->doCallbacks();
	}
}
abstract class UHU_CallbackProcess_RunOnce extends UHU_CallbackProcess
{
	public function __construct()
	{
		$this->success_callbacks = new UHU_Collection_Callbacks_RunOnce($this);
		$this->failure_callbacks = new UHU_Collection_Callbacks_RunOnce($this);
	}
}
?>